package array;

import org.junit.jupiter.api.Test;

import java.util.Arrays;

public class TestArrays {
    /**
     * Arrays 方法：
     *   Arrays.copyOf(int[] src, int length)：数组复制
     *   Arrays.equals(int[] arr1, int[] arr2)：数组比较
     */
    @Test
    public void test01() {
        int[] arr = {5, 6, 8, 12, 3, 90};
        System.out.println(Arrays.toString(arr));  // [5, 6, 8, 12, 3, 90]
        int[] copy = Arrays.copyOf(arr, arr.length);
        System.out.println(Arrays.toString(copy));  // [5, 6, 8, 12, 3, 90]

        boolean result = Arrays.equals(arr, copy);  // true
        System.out.println(result);
    }
}
